package acceptance;

import junit.framework.Assert;




/**
 * @author reut
 * tests different parameters of login
 * IMPORTANT:in order to work these conditions need to hold:
 *  not registered: username mira
 *  registered: username: dani,password:1234
 *  registered: username: yosi,password:2222
 */
public class LoginTest extends ProjectTest
{
	@Override
	public void setUp(){
		super.setUp();
		this._bridge.register("dani", "1234");
		this._bridge.register("yosi", "2222");

	}

	/**
	 *  tests when username is not in the system
	 */
	public void testUserNameNotFoundLogin()
	{
		Assert.assertFalse("username not found", this._bridge.login("mira", "2222"));
	}
	/**
	 * tests when password don't match username's password
	 */
	public void testBadPasswordLogin()
	{
		Assert.assertFalse("password don't match username's password", this._bridge.login("dani", "5555"));
	}
	/**
	 * tests cases of successful login
	 */
	public void testCorrectLogin()
	{
		Assert.assertTrue("logged in succssesfuly", this._bridge.login("yosi", "2222"));
		Assert.assertTrue("logged in succssesfuly", this._bridge.login("dani", "1234"));


	}

}
